package com.wlz.creational.builders;

import com.wlz.creational.builders.builders.CarBuilder;
import com.wlz.creational.builders.builders.CarManualBuilder;
import com.wlz.creational.builders.cars.Car;
import com.wlz.creational.builders.cars.Manual;
import com.wlz.creational.builders.director.Director;

/**
 * @author： wlz
 * @Date 2020/10/14 14:26
 * @description： TODO
 * @version: 1.0
 */
public class Demo {

    public static void main(String[] args) {
        Director director = new Director();

        CarBuilder builder = new CarBuilder();
        director.constructSportsCar(builder);

        Car car = builder.getResult();
        System.out.println("Car built:\n" + car.getType());

        CarManualBuilder manualBuilder = new CarManualBuilder();

        director.constructSportsCar(manualBuilder);
        Manual carManual = manualBuilder.getResult();
        System.out.println("\nCar manual built:\n" + carManual.print());
    }
}
